import request from '@/utils/request'

// 查询仓库列表
export function listWarehouses(query) {
  return request({
    url: '/wm/warehouses/list',
    method: 'get',
    params: query
  })
}

// 查询仓库信息
export function checkWarehouses(query,code) {
  return request({
    url: '/wm/initial/whInfo/'+code,
    method: 'get',
     params: query
  })
}

// 同步物料
export function SyncMaterial(query) {
  return request({
    url: '/wm/initial/Synchronize',
    method: 'get',
    params: query
  })
}

// 导出物料
export function exportMaterial(query) {
  return request({
    url: '/wm/initial/export',
    method: 'get',
    params: query
  })
}

// 获取仓库字典设置
export function invoiceType (query) {
  return request({
    url: '/system/dict/data/list',
    method: 'get',
    params: query
  })
}


// 更新期初价格/数量/金额
export function updateMaterial(data){
	return request({
		method:"put",
		url:"/wm/initial",
		data:data
	})
}

//复制当前物料信息(新增期初)
export function addMaterial(data){
	return request({
		method:"post",
		url:"/wm/initial",
		data:data
	})
}

//入库
export function addInWm(data){
	return request({
		method:"post",
		url:"/wm/initial/enter",
     data:data
	})
}

//批号设置
export function setBatchNumber (data){
	return request({
		method:"post",
		url:"/wm/initial/batchNumber",
     data:data
	})
}

//仓库期间
export function blanceAvailable(query) {
  return request({
    url: '/wm/period/available',
    method: 'get',
    params: query
  })
}

// 清空
export function emptyInitial(query) {
  return request({
     url: '/wm/initial/clear',
     method: 'get',
     params: query
   })
 }

 // 撤回
export function revokeInitial(query) {
  return request({
     url: '/wm/initial/revoke',
     method: 'get',
     params: query
   })
 }